﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace nudota
{
    public partial class Preference : Form
    {
        public Preference()
        {
            InitializeComponent();
        }

        private void Preference_Load(object sender, EventArgs e)
        {
            tbWar3.Text = Form1.inireadvalue("GameInfo", "war3");
            tbNick.Text = Form1.inireadvalue("UserInfo", "nick");            
        }

        private void button3_Click(object sender, EventArgs e)
        {
            Form1.iniwritevalue("GameInfo", "war3", tbWar3.Text);
            Form1.iniwritevalue("UserInfo", "nick", tbNick.Text);
            Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Form1 form1 = (Form1)this.Owner;
            if (form1.odOpenGame.ShowDialog() == DialogResult.OK)
                tbWar3.Text = form1.odOpenGame.FileName;
        }
    }
}